package kr.ac.skhu.m.dao;

import java.sql.SQLException;

import kr.ac.skhu.m.domain.Comment;

import org.springframework.jdbc.core.JdbcTemplate;

public class CommentD extends JdbcTemplate {
	
	public int insertComment(Comment comment) throws SQLException {
		
		String sql = "INSERT INTO comment VALUES (?,?,now(),?,?,?)";
		
		int result = update(sql, new Object[]{
				comment.getArticleNo(),
				comment.getWriter(),
				comment.getComment(),
				comment.getPassword(),
				comment.getCommentNo()
		});		
		
		return result;
		
	}
	
}
